package com.zmm.xiaohashu.auth.controller;

import com.zmm.framework.biz.operationlog.aspect.ApiOperationLog;
import com.zmm.framework.common.response.Response;
import com.zmm.xiaohashu.auth.model.vo.user.UserLoginReqVO;
import com.zmm.xiaohashu.auth.service.UserService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: 福禄寿
 * @Date: 2024/9/10 下午5:15
 * @Des: xiaohashu
 **/
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {
    @Resource
    private UserService userService;

    @PostMapping("/login")
    @ApiOperationLog(description = "用户登录/注册")
    public Response<String> loginAndRegister(@Validated @RequestBody UserLoginReqVO userLoginReqVO) {
        return userService.loginAndRegister(userLoginReqVO);
    }

}
